package com.kingdee.eas.dahua.exponent.app;

import java.util.Date;

import org.apache.log4j.Logger;

import com.kingdee.bos.BOSException;
import com.kingdee.bos.Context;
import com.kingdee.bos.dao.IObjectPK;
import com.kingdee.bos.dao.IObjectValue;
import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
import com.kingdee.eas.common.EASBizException;
import com.kingdee.eas.dahua.enums.StateEnum;
import com.kingdee.eas.dahua.exponent.WorkCostPriceInfo;
import com.kingdee.eas.dahua.helper.DaHuaHelper;
import com.kingdee.eas.fdc.basedata.FDCSQLBuilder;
import com.kingdee.eas.util.app.ContextUtil;

public class WorkCostPriceControllerBean extends AbstractWorkCostPriceControllerBean
{
    private static Logger logger =
        Logger.getLogger("com.kingdee.eas.dahua.exponent.app.WorkCostPriceControllerBean");
    
    protected void _unAudit(Context ctx, IObjectValue model)throws BOSException {
		super._unAudit(ctx, model);
		WorkCostPriceInfo info = (WorkCostPriceInfo)model;
		info.setState(StateEnum.save);
		info.setAuditor(null);
		try {
			_update(ctx,new ObjectUuidPK(info.getId()),info);
		} catch (EASBizException e) {
			e.printStackTrace();
		}
	}
	protected void _audit(Context ctx, IObjectValue model) throws BOSException {
		super._audit(ctx, model);
		WorkCostPriceInfo info = (WorkCostPriceInfo)model;
		info.setState(StateEnum.audited);
		info.setAuditor(ContextUtil.getCurrentUserInfo(ctx));
		try {
			_update(ctx,new ObjectUuidPK(info.getId()),info);
		} catch (EASBizException e) {
			e.printStackTrace();
		}
	}
	
	protected void _closed(Context ctx, IObjectValue model) throws BOSException {
		super._closed(ctx, model);
		WorkCostPriceInfo info = (WorkCostPriceInfo)model;
		info.setState(StateEnum.closed);
		try {
			_update(ctx,new ObjectUuidPK(info.getId()),info);
		} catch (EASBizException e) {
			e.printStackTrace();
		}
		
	}
	
    
}